package com.cdgeekcamp.redas.db.model;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;

import java.util.List;
import java.util.Optional;

public interface KeyWordsRepository extends CrudRepository<KeyWords, Integer> {

    Iterable<KeyWords> findByParentId(Integer parentId);

    Page<KeyWords> findAll(Pageable pageable);
    Optional<KeyWords> findByKeyNameAndParentId(String KeyName, Integer parentId);

    Optional<KeyWords> findByKeyName(String keyName);

    List<KeyWords> findByLevel(Integer level);

}
